//
//  GCMCBTJTableViewCell.m
//  GeeCityManager
//
//  Created by 聚城科技 on 16/10/10.
//  Copyright © 2016年 聚城科技. All rights reserved.
//

#import "GCMCBTJTableViewCell.h"

@implementation GCMCBTJTableViewCell{
    
    UILabel *_areaLab;
    UILabel *_Dyingchacount;
    UILabel *_Dyichacount;
    UILabel *_Dweichacount;
    UILabel *_Syingchacount;
    UILabel *_Syichacount;
    UILabel *_Sweichacount;
    
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self createUI];
    }
    return self;
}

-(void)createUI{
    
    
    self.contentView.backgroundColor = [UIColor whiteColor];
    _areaLab = [[UILabel alloc]initWithFrame:CGRectMake(10, 0 , (SCREEN_WIDTH - 20), 50)];
    //    _areaLab.backgroundColor = [UIColor blueColor];
    _areaLab.textColor  = [UIColor colorWithRed:0.02 green:0.45 blue:0.82 alpha:1.0];
    _areaLab.font = [UIFont systemFontOfSize:17];
    _areaLab.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:_areaLab];
    
    UILabel * sbLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 110 , (SCREEN_WIDTH - 20)/4, 60)];
    //    sbLabel.backgroundColor = [UIColor orangeColor];
    //    sbLabel.textColor  = [UIColor whiteColor];
    sbLabel.text = @"水表";
    sbLabel.textAlignment = NSTextAlignmentCenter;
    sbLabel.font = [UIFont systemFontOfSize:16];
    [self.contentView addSubview:sbLabel];
    
    UILabel * dbLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 50, (SCREEN_WIDTH - 20)/4, 60)];
    //    dbLabel.backgroundColor = [UIColor yellowColor];
    //    dbLabel.textColor  = [UIColor whiteColor];
    dbLabel.text = @"电表";
    dbLabel.textAlignment = NSTextAlignmentCenter;
    dbLabel.font = [UIFont systemFontOfSize:16];
    [self.contentView addSubview:dbLabel];
    
    //  电表表格
    NSArray *dianbiaoArray = @[@"应查",@"已查",@"未查"];
    for (int i = 1; i < 4; i++) {
        UILabel * dbLabel = [[UILabel alloc]initWithFrame:CGRectMake(10 +i*(SCREEN_WIDTH - 20)/4, 50, (SCREEN_WIDTH - 20)/4, 30)];
        //        dbLabel.backgroundColor = [UIColor orangeColor];
        //        dbLabel.textColor  = [UIColor whiteColor];
        dbLabel.text = dianbiaoArray[i-1];
        dbLabel.textAlignment = NSTextAlignmentCenter;
        [self.contentView addSubview:dbLabel];
    }
    _Dyichacount = [[UILabel alloc]initWithFrame:CGRectMake(10 +2*(SCREEN_WIDTH - 20)/4, 80 , (SCREEN_WIDTH - 20)/4, 30)];
    //    _Dyichacount.backgroundColor = [UIColor grayColor];
    //    _Dyichacount.textColor  = [UIColor whiteColor];
    _Dyichacount.font = [UIFont systemFontOfSize:16];
    _Dyichacount.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:_Dyichacount];
    
    _Dweichacount = [[UILabel alloc]initWithFrame:CGRectMake(10 +3*(SCREEN_WIDTH - 20)/4, 80 , (SCREEN_WIDTH - 20)/4, 30)];
    //    _Dweichacount.backgroundColor = [UIColor redColor];
    //    _Dweichacount.textColor  = [UIColor whiteColor];
    _Dweichacount.font = [UIFont systemFontOfSize:16];
    _Dweichacount.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:_Dweichacount];
    
    _Dyingchacount = [[UILabel alloc]initWithFrame:CGRectMake(10 +(SCREEN_WIDTH - 20)/4, 80, (SCREEN_WIDTH - 20)/4, 30)];
    //    _Dyingchacount.backgroundColor = [UIColor grayColor];
    //    _Dyingchacount.textColor  = [UIColor whiteColor];
    _Dyingchacount.font = [UIFont systemFontOfSize:16];
    _Dyingchacount.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:_Dyingchacount];
    
    for (int i = 1; i < 4; i++) {
        UILabel * sbLabel = [[UILabel alloc]initWithFrame:CGRectMake(10 +i*(SCREEN_WIDTH - 20)/4, 110 , (SCREEN_WIDTH - 20)/4, 30)];
        //        sbLabel.backgroundColor = [UIColor orangeColor];
        //        sbLabel.textColor  = [UIColor whiteColor];
        sbLabel.text = dianbiaoArray[i-1];
        sbLabel.textAlignment = NSTextAlignmentCenter;
        [self.contentView addSubview:sbLabel];
    }
    _Syichacount = [[UILabel alloc]initWithFrame:CGRectMake(10 +2*(SCREEN_WIDTH - 20)/4, 140 , (SCREEN_WIDTH - 20)/4, 30)];
    //    _Syichacount.backgroundColor = [UIColor blueColor];
    //    _Syichacount.textColor  = [UIColor whiteColor];
    _Syichacount.font = [UIFont systemFontOfSize:16];
    _Syichacount.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:_Syichacount];
    
    _Sweichacount = [[UILabel alloc]initWithFrame:CGRectMake(10 +3*(SCREEN_WIDTH - 20)/4, 140 , (SCREEN_WIDTH - 20)/4, 30)];
    //    _Sweichacount.backgroundColor = [UIColor blueColor];
    //    _Sweichacount.textColor  = [UIColor whiteColor];
    _Sweichacount.font = [UIFont systemFontOfSize:16];
    _Sweichacount.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:_Sweichacount];
    
    _Syingchacount = [[UILabel alloc]initWithFrame:CGRectMake(10 +(SCREEN_WIDTH - 20)/4, 140 , (SCREEN_WIDTH - 20)/4, 30)];
    //    _Syingchacount.backgroundColor = [UIColor redColor];
    //    _Syingchacount.textColor  = [UIColor whiteColor];
    _Syingchacount.font = [UIFont systemFontOfSize:16];
    _Syingchacount.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:_Syingchacount];
    
    for (int i = 0; i < 3; i++) {
        UILabel * lineLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 50 + 60*i , (SCREEN_WIDTH - 20), 1)];
        lineLabel.layer.borderColor = [[UIColor colorWithRed:0.76 green:0.76 blue:0.76 alpha:1]CGColor];
        lineLabel.layer.borderWidth = 0.5;
        [self.contentView addSubview:lineLabel];
    }
    for (int i = 0; i < 2; i++) {
        UILabel * lineLabel = [[UILabel alloc]initWithFrame:CGRectMake(10 +(SCREEN_WIDTH - 20)/4, 80 + 60*i , (SCREEN_WIDTH - 20)/4*3, 1)];
        lineLabel.layer.borderColor = [[UIColor colorWithRed:0.76 green:0.76 blue:0.76 alpha:1]CGColor];
        lineLabel.layer.borderWidth = 0.5;
        [self.contentView addSubview:lineLabel];
    }
    for (int i = 1; i < 4; i++) {
        UILabel * lineLabel = [[UILabel alloc]initWithFrame:CGRectMake(10 +i*(SCREEN_WIDTH - 20)/4, 50, 1, 120)];
        lineLabel.layer.borderColor = [[UIColor colorWithRed:0.76 green:0.76 blue:0.76 alpha:1]CGColor];
        lineLabel.layer.borderWidth = 0.5;
        [self.contentView addSubview:lineLabel];
    }
    
    

    
    
}

-(void)setDic:(NSDictionary *)dic{

    NSDictionary *dict = [[NSDictionary alloc]init];
    dict  = dic;
    _areaLab.text = [dict valueForKey:@"a_name"];
    _Dyingchacount.text = [dict valueForKey:@"dyc"];
    _Dweichacount.text = [dict valueForKey:@"dwc"];
    _Dyichacount.text = [dict valueForKey:@"dyic"];
    _Syingchacount.text = [dict valueForKey:@"syc"];
    _Syichacount.text = [dict valueForKey:@"syic"];
    _Sweichacount.text = [dict valueForKey:@"swc"];
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
